/*
 * Copyright (c) GK.  All rights reserved.
 */

#ifndef SP2305_CMOS_EX_H_
#define SP2305_CMOS_EX_H_

#include "awb_comm.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

static const ISP_CMOS_DPC_S g_stCmosDpc = {
    /* ISO */
    /* 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200, 1638400, 3276800 */
    { 0, 0, 100, 152, 220, 220, 220, 220, 220, 220, 152, 152, 152, 152, 152, 152 }, /* au16Strength[16] */
    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 50, 50, 50, 50, 50 },                       /* au16BlendRatio[16] */
    0, /* 0 for after drc, 1 for before wdr */
};

static const ISP_CMOS_GE_S g_stIspGe = {
    /* For GE */
    1,    /* bEnable */
    13,   /* u8Slope */
    13,   /* u8SensiSlope */
    4800, /* u16SensiThr */
    /* ISO */
    /*   1,    2,      4,     8,    16,    32,    64,   128,   256,   512,  1024,  2048,  4096,  8192, 16384, 32768 */
    { 4800, 4800, 4800, 4800, 4960, 4960, 4960, 4960, 5120, 5120, 5120, 5120, 5280, 5280, 5280, 5280 },
    { 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131 },
    { 16384, 16384, 16384, 16384, 16384, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768 }
};

static const ISP_CMOS_DEMOSAIC_S g_stIspDemosaic = {
    1,  /* bEnable */
    /* au8NonDirStr */
    /* 1,    2,    4,    8,   16,   32,   64,   128,   256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
    /* au8NonDirLFDetailEhc */
    { 32, 32, 32, 36, 36, 36, 32, 22, 20, 18, 18, 18, 18, 18, 18, 18 },
    /* au8NonDirHFDetailEhc */
    { 3, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 },
    /* au8DetailSmoothRange */
    { 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 7, 7, 7, 7, 7, 7 },
};

static const ISP_CMOS_ANTIFALSECOLOR_S g_stIspAntiFalseColor = {
    1, /* bEnable */
    /* 1,    2,    4,    8,   16,   32,   64,   128,   256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 10, 10, 10, 12, 15, 16, 16, 15, 8, 6, 5, 4, 3, 2, 1, 0 },
    { 8, 8, 10, 12, 15, 16, 16, 15, 8, 6, 5, 4, 3, 2, 1, 0 },
};

/* BAYER NR */
static ISP_CMOS_NOISE_CALIBRATION_S g_stIspNoiseCalibration = {
    12,  /* Calibration Lut Num */
    {
        { 106.0f, 0.017536f, 0.024127f },
        { 117.0f, 0.01939f, 0.025791f },
        { 227.0f, 0.037736f, 0.040171f },
        { 470.0f, 0.07777f, 0.084227f },
        { 1747.0f, 0.287293f, 0.379383f },
        { 4002.0f, 0.655649f, 1.155996f },
        { 6491.0f, 1.065072f, 2.335924f },
        { 15969.0f, 2.720477f, 10.456544f },
        { 29738.0f, 5.172001f, 30.797239f },
        { 59343.0f, 10.782349f, 100.457473f },
        { 103124.0f, 21.000038f, 210.387179f },
        { 238817.0f, 28.774144f, 257.811098f }
    }
};

static const ISP_CMOS_BAYERNR_S g_stIspBayerNr = {
    1,                                                                   /* bEnable */
    0,                                                                   /* bBnrMonoSensorEn */
    0,                                                                   /* bNrLscEnable */
    96,                                                                  /* u8BnrLscMaxGain */
    256,                                                                 /* u16BnrLscCmpStrength */
    { 40, 45, 50, 50, 50, 50, 50, 46, 40, 40, 30, 28, 24, 20, 16, 16 },  /* FineStr */
    {
        { 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 },  /*  ChromaStrR */
        { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 },  /*  ChromaStrGr */
        { 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2 },  /*  ChromaStrGb */
        { 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }   /*  ChromaStrB */
    },
    { 0, 0, 0, 0 },  /*  WDRFrameStr */
    { 0, 0, 0, 0 },  /*  FusionFrameStr */
    {
        { 114, 117, 120, 120, 120, 120, 120, 140, 160, 160, 180, 200, 200, 200, 200, 200 },  /*  CoarseStrR */
        { 100, 105, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110 },  /*  CoarseStrGR */
        { 100, 105, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110 },  /* CoarseStrGB */
        { 114, 117, 120, 120, 120, 120, 120, 140, 160, 160, 180, 200, 200, 200, 200, 200 }   /*  CoarseStrB */
    },
    { 35, 40, 50, 80, 100, 140, 200, 240, 280, 300, 300, 400, 400, 400, 400, 400 },  /* lutCoringWeight */
    {
        60, 60, 60, 60, 65, 65, 65, 65, 70, 70, 70, 70, 70,  70,  70,  70,
        80, 80, 80, 85, 85, 85, 90, 90, 90, 95, 95, 95, 100, 100, 100, 100, 100
    },  /* CoringRatio */
};

static const ISP_CMOS_LDCI_S g_stIspLdci = {
    /* bEnable */
    1,
    /* u8GaussLPFSigma */
    36,
    /* au8HePosWgt */
    { 50, 50, 50, 50, 48, 30, 30, 20, 10, 0, 0, 0, 0, 0, 0, 0 },

    /* au8HePosSigma */
    { 80, 72, 64, 48, 40, 24, 24, 20, 12, 8, 6, 2, 1, 1, 1, 1 },

    /* au8HePosMean */
    { 60, 50, 40, 40, 30, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 },

    /* au8HeNegWgt */
    { 50, 45, 45, 45, 45, 40, 40, 30, 20, 10, 0, 0, 0, 0, 0, 0 },

    /* au8HeNegSigma */
    { 80, 80, 80, 80, 80, 72, 64, 54, 36, 8, 6, 2, 1, 1, 1, 1 },

    /* au8HeNegMean */
    { 128, 128, 50, 60, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70 },

    /* au16BlcCtrl */
    { 20, 20, 20, 20, 20, 20, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30 }
};

static const ISP_CMOS_GAMMA_S g_stIspGamma = {
    {
        0,    19,   38,   58,   77,   97,   117,  137,  156,  176,  195,  215,  234,  253,  272,  290,  308,  326,  344,
        364,  383,  401,  419,  436,  453,  470,  487,  504,  521,  539,  557,  576,  596,  617,  627,  637,  648,  658,
        669,  679,  690,  701,  712,  723,  734,  745,  757,  768,  779,  791,  803,  815,  827,  839,  851,  863,  876,
        888,  901,  914,  927,  940,  953,  967,  981,  987,  994,  1001, 1008, 1015, 1022, 1029, 1036, 1043, 1051, 1058,
        1066, 1073, 1081, 1088, 1096, 1104, 1111, 1119, 1127, 1135, 1143, 1150, 1158, 1166, 1174, 1182, 1190, 1198, 1206,
        1214, 1222, 1230, 1238, 1246, 1254, 1262, 1270, 1278, 1286, 1294, 1302, 1310, 1318, 1326, 1334, 1341, 1349, 1357,
        1365, 1372, 1380, 1387, 1395, 1402, 1409, 1417, 1424, 1431, 1438, 1445, 1452, 1459, 1466, 1472, 1479, 1485, 1492,
        1499, 1505, 1511, 1518, 1524, 1531, 1537, 1543, 1549, 1556, 1562, 1568, 1574, 1580, 1586, 1592, 1598, 1604, 1610,
        1616, 1622, 1628, 1634, 1639, 1645, 1651, 1657, 1663, 1668, 1674, 1680, 1685, 1691, 1697, 1702, 1708, 1713, 1719,
        1724, 1730, 1736, 1741, 1747, 1752, 1758, 1763, 1769, 1774, 1780, 1785, 1790, 1796, 1801, 1807, 1812, 1818, 1823,
        1829, 1834, 1840, 1845, 1850, 1856, 1861, 1867, 1872, 1877, 1883, 1888, 1893, 1899, 1904, 1909, 1915, 1920, 1925,
        1930, 1936, 1941, 1946, 1951, 1957, 1962, 1967, 1972, 1977, 1982, 1988, 1993, 1998, 2003, 2008, 2013, 2018, 2023,
        2028, 2033, 2038, 2043, 2048, 2053, 2058, 2063, 2068, 2073, 2078, 2082, 2087, 2092, 2097, 2102, 2107, 2111, 2116,
        2121, 2126, 2131, 2135, 2140, 2145, 2149, 2154, 2159, 2164, 2168, 2173, 2177, 2182, 2187, 2191, 2196, 2200, 2205,
        2210, 2214, 2219, 2223, 2228, 2232, 2237, 2241, 2246, 2250, 2254, 2259, 2263, 2268, 2272, 2276, 2281, 2285, 2289,
        2294, 2298, 2302, 2307, 2311, 2315, 2319, 2324, 2328, 2332, 2336, 2340, 2344, 2349, 2353, 2357, 2361, 2365, 2369,
        2373, 2377, 2381, 2385, 2389, 2393, 2397, 2401, 2405, 2409, 2413, 2416, 2420, 2424, 2428, 2432, 2436, 2439, 2443,
        2447, 2450, 2454, 2458, 2461, 2465, 2468, 2472, 2475, 2479, 2482, 2486, 2489, 2493, 2496, 2500, 2503, 2506, 2510,
        2513, 2516, 2520, 2523, 2526, 2529, 2533, 2536, 2539, 2542, 2546, 2549, 2552, 2555, 2558, 2561, 2565, 2568, 2571,
        2574, 2577, 2580, 2583, 2586, 2590, 2593, 2596, 2599, 2602, 2605, 2608, 2611, 2614, 2617, 2621, 2624, 2627, 2630,
        2633, 2636, 2639, 2642, 2646, 2649, 2652, 2656, 2659, 2662, 2665, 2668, 2671, 2674, 2677, 2680, 2683, 2686, 2690,
        2693, 2696, 2699, 2702, 2705, 2708, 2711, 2714, 2717, 2720, 2723, 2726, 2729, 2732, 2735, 2738, 2741, 2744, 2747,
        2750, 2753, 2756, 2759, 2762, 2764, 2767, 2770, 2773, 2776, 2779, 2782, 2785, 2788, 2791, 2794, 2796, 2799, 2802,
        2805, 2808, 2811, 2814, 2817, 2820, 2822, 2825, 2828, 2831, 2834, 2837, 2840, 2843, 2845, 2848, 2851, 2853, 2856,
        2859, 2862, 2865, 2868, 2871, 2874, 2877, 2879, 2882, 2885, 2887, 2890, 2893, 2896, 2899, 2901, 2904, 2907, 2909,
        2912, 2915, 2918, 2920, 2923, 2926, 2929, 2932, 2934, 2937, 2940, 2942, 2945, 2948, 2951, 2954, 2956, 2959, 2962,
        2964, 2966, 2969, 2972, 2974, 2977, 2980, 2983, 2986, 2988, 2991, 2994, 2996, 2998, 3001, 3004, 3006, 3009, 3012,
        3015, 3018, 3020, 3023, 3026, 3028, 3031, 3033, 3035, 3038, 3040, 3043, 3046, 3048, 3051, 3054, 3057, 3059, 3062,
        3064, 3066, 3069, 3071, 3074, 3077, 3080, 3082, 3085, 3088, 3090, 3093, 3095, 3097, 3100, 3102, 3105, 3108, 3110,
        3113, 3115, 3117, 3120, 3122, 3125, 3128, 3130, 3133, 3135, 3138, 3140, 3143, 3145, 3147, 3150, 3152, 3155, 3158,
        3160, 3163, 3165, 3167, 3170, 3172, 3175, 3178, 3180, 3183, 3185, 3187, 3189, 3192, 3194, 3196, 3199, 3201, 3204,
        3207, 3209, 3211, 3214, 3217, 3219, 3222, 3224, 3226, 3228, 3231, 3233, 3235, 3238, 3241, 3243, 3245, 3247, 3250,
        3252, 3254, 3257, 3260, 3262, 3264, 3267, 3269, 3271, 3273, 3276, 3279, 3281, 3283, 3286, 3288, 3290, 3292, 3295,
        3298, 3300, 3302, 3305, 3307, 3309, 3311, 3313, 3316, 3318, 3320, 3322, 3325, 3327, 3329, 3332, 3335, 3337, 3339,
        3342, 3344, 3346, 3348, 3350, 3353, 3355, 3357, 3360, 3362, 3364, 3366, 3368, 3371, 3373, 3375, 3378, 3380, 3382,
        3384, 3386, 3389, 3391, 3393, 3396, 3398, 3400, 3402, 3405, 3407, 3409, 3411, 3413, 3416, 3418, 3420, 3423, 3425,
        3427, 3429, 3431, 3434, 3436, 3438, 3441, 3443, 3445, 3447, 3449, 3452, 3454, 3456, 3459, 3461, 3463, 3465, 3467,
        3469, 3471, 3473, 3475, 3478, 3480, 3482, 3484, 3487, 3489, 3491, 3494, 3496, 3498, 3500, 3502, 3504, 3506, 3508,
        3511, 3513, 3515, 3517, 3519, 3521, 3523, 3525, 3528, 3530, 3532, 3534, 3536, 3538, 3540, 3542, 3545, 3547, 3549,
        3551, 3553, 3555, 3557, 3559, 3561, 3564, 3566, 3568, 3570, 3572, 3574, 3576, 3578, 3581, 3583, 3585, 3587, 3589,
        3591, 3593, 3595, 3598, 3600, 3602, 3604, 3606, 3608, 3610, 3612, 3614, 3616, 3618, 3620, 3622, 3624, 3626, 3628,
        3631, 3633, 3635, 3637, 3639, 3641, 3643, 3645, 3647, 3649, 3651, 3653, 3655, 3657, 3659, 3661, 3663, 3665, 3667,
        3670, 3672, 3674, 3676, 3678, 3680, 3682, 3684, 3686, 3688, 3690, 3692, 3694, 3696, 3698, 3700, 3702, 3704, 3706,
        3708, 3710, 3712, 3714, 3716, 3718, 3720, 3722, 3724, 3726, 3728, 3730, 3732, 3734, 3736, 3738, 3740, 3742, 3744,
        3746, 3748, 3750, 3752, 3754, 3756, 3758, 3760, 3762, 3764, 3766, 3767, 3769, 3771, 3773, 3775, 3777, 3779, 3781,
        3783, 3785, 3787, 3789, 3791, 3793, 3795, 3797, 3799, 3801, 3803, 3804, 3806, 3808, 3810, 3812, 3814, 3816, 3818,
        3820, 3822, 3824, 3826, 3828, 3830, 3832, 3834, 3836, 3837, 3839, 3841, 3843, 3845, 3847, 3849, 3851, 3853, 3855,
        3857, 3858, 3860, 3862, 3864, 3866, 3868, 3870, 3872, 3873, 3875, 3877, 3879, 3881, 3883, 3885, 3887, 3888, 3890,
        3892, 3894, 3896, 3898, 3900, 3902, 3904, 3905, 3907, 3909, 3911, 3913, 3915, 3917, 3919, 3920, 3922, 3924, 3926,
        3928, 3930, 3932, 3934, 3935, 3937, 3939, 3941, 3943, 3945, 3947, 3949, 3950, 3952, 3954, 3955, 3957, 3959, 3961,
        3963, 3965, 3967, 3969, 3971, 3972, 3974, 3976, 3977, 3979, 3981, 3983, 3985, 3987, 3989, 3991, 3993, 3994, 3996,
        3998, 4000, 4001, 4003, 4005, 4006, 4008, 4010, 4012, 4014, 4016, 4018, 4020, 4022, 4023, 4025, 4027, 4028, 4030,
        4032, 4034, 4036, 4037, 4039, 4041, 4042, 4044, 4046, 4048, 4050, 4052, 4054, 4056, 4058, 4059, 4061, 4063, 4064,
        4066, 4068, 4070, 4072, 4073, 4075, 4077, 4078, 4080, 4082, 4084, 4086, 4087, 4089, 4091, 4092, 4094, 4095
    }
};

static const ISP_CMOS_SHARPEN_S g_stIspYuvSharpen = {
    /* u8SkinUmin */
    110,
    /* u8SkinVmin */
    128,
    /* u8SkinUmax */
    128,
    /* u8SkinVmax */
    149,

    /* Manual Para */
    {
        /* au8LumaWgt */
        {
            31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
            31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31
        },
        /* u16TextureStr */
        {
            420, 420, 390, 390, 390, 390, 390, 370, 350, 330, 310, 290, 270, 270, 270, 270,
            270, 270, 266, 260, 244, 230, 230, 230, 230, 230, 230, 210, 190, 190, 170, 150
        },
        /* u16EdgeStr */
        {
            120, 123, 125, 128, 130, 135, 140, 148, 160, 168, 180, 190, 200, 210, 210, 210,
            210, 210, 200, 190, 185, 175, 165, 160, 146, 136, 130, 128, 125, 123, 120, 120
        },
        /* u16TextureFreq */
        160,
        /* u16EdgeFreq */
        100,
        /* u8OverShoot */
        55,
        /* u8UnderShoot */
        70,
        /* u8shootSupStr */
        10,
        /* u8shootSupAdj */
        9,
        /* u8DetailCtrl */
        128,
        /* u8DetailCtrlThr */
        180,
        /* u8EdgeFiltStr */
        60,
        /* u8EdgeFiltMaxCap */
        18,
        /* u8RGain */
        28,
        /* u8GGain */
        32,
        /* u8BGain */
        31,
        /* u8SkinGain */
        23,
        /* u8MaxSharpGain */
        67,
        /* u8WeakDetailGain */
        6

    },
    /* Auto Para */
    {
        /* au16LumaWgt */
        /* ISO */
        /*     100,    200,    400,    800,   1600,   3200,   6400,  12800,
            25600,  51200, 102400, 204800, 409600, 819200,1638400,3276800 */
        {
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 1, 1, 1 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 2, 2, 2 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 4, 4, 4 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 5, 5, 5 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 7, 7, 7 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 8, 8, 8 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 9, 9, 9 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 10, 10, 10 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 12, 12, 12 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 13, 13, 13 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 14, 14, 14 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 15, 15, 15 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 17, 17, 17 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 18, 18, 18 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 19, 19, 19 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 20, 20, 20 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 22, 22, 22 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 23, 23, 23 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 24, 24, 24 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 26, 26, 26 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 26, 26, 26 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 26, 26, 26 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 26, 26, 26 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28 },
            { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 28, 28, 28 }
        },
        /* au16TextureStr */
        /* ISO */
        /*     100,    200,    400,    800,   1600,   3200,   6400,  12800,
              25600,  51200, 102400, 204800, 409600, 819200,1638400,3276800 */
        {
            { 285, 285, 264, 264, 264, 128, 128, 128, 128, 128, 128, 128, 128, 28, 28, 28 },
            { 300, 300, 276, 276, 276, 148, 148, 148, 148, 148, 148, 148, 148, 43, 43, 43 },
            { 315, 315, 292, 292, 292, 177, 177, 177, 177, 177, 177, 177, 177, 59, 59, 59 },
            { 328, 328, 307, 307, 307, 211, 211, 211, 211, 211, 211, 211, 211, 75, 75, 75 },
            { 337, 337, 316, 316, 316, 247, 247, 247, 247, 247, 247, 247, 247, 91, 91, 91 },
            { 345, 345, 324, 324, 324, 281, 281, 281, 281, 281, 281, 281, 281, 106, 106, 106 },
            { 352, 352, 331, 331, 331, 310, 310, 310, 310, 310, 310, 310, 310, 121, 121, 121 },
            { 357, 357, 336, 336, 336, 331, 331, 331, 331, 331, 331, 331, 331, 136, 136, 136 },
            { 359, 359, 337, 337, 337, 342, 342, 342, 342, 342, 342, 342, 342, 152, 152, 152 },
            { 361, 361, 338, 338, 338, 348, 348, 348, 348, 348, 348, 348, 348, 167, 167, 167 },
            { 363, 363, 338, 338, 338, 351, 351, 351, 351, 351, 351, 351, 351, 183, 183, 183 },
            { 364, 364, 338, 338, 338, 352, 352, 352, 352, 352, 352, 352, 352, 199, 199, 199 },
            { 364, 364, 337, 337, 337, 350, 350, 350, 350, 350, 350, 350, 350, 214, 214, 214 },
            { 365, 365, 336, 336, 336, 347, 347, 347, 347, 347, 347, 347, 347, 228, 228, 228 },
            { 364, 364, 335, 335, 335, 344, 344, 344, 344, 344, 344, 344, 344, 241, 241, 241 },
            { 363, 363, 333, 333, 333, 341, 341, 341, 341, 341, 341, 341, 341, 254, 254, 254 },
            { 361, 361, 331, 331, 331, 338, 338, 338, 338, 338, 338, 338, 338, 267, 267, 267 },
            { 358, 358, 328, 328, 328, 333, 333, 333, 333, 333, 333, 333, 333, 283, 283, 283 },
            { 355, 355, 324, 324, 324, 327, 327, 327, 327, 327, 327, 327, 327, 298, 298, 298 },
            { 351, 351, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 320, 313, 313, 313 },
            { 346, 346, 316, 316, 316, 313, 313, 313, 313, 313, 313, 313, 313, 325, 325, 325 },
            { 342, 342, 312, 312, 312, 305, 305, 305, 305, 305, 305, 305, 305, 338, 338, 338 },
            { 337, 337, 308, 308, 308, 296, 296, 296, 296, 296, 296, 296, 296, 348, 348, 348 },
            { 333, 333, 304, 304, 304, 288, 288, 288, 288, 288, 288, 288, 288, 353, 353, 353 },
            { 329, 329, 300, 300, 300, 279, 279, 279, 279, 279, 279, 279, 279, 350, 350, 350 },
            { 324, 324, 295, 295, 295, 270, 270, 270, 270, 270, 270, 270, 270, 343, 343, 343 },
            { 318, 318, 290, 290, 290, 260, 260, 260, 260, 260, 260, 260, 260, 330, 330, 330 },
            { 313, 313, 285, 285, 285, 249, 249, 249, 249, 249, 249, 249, 249, 313, 313, 313 },
            { 308, 308, 280, 280, 280, 239, 239, 239, 239, 239, 239, 239, 239, 287, 287, 287 },
            { 303, 303, 276, 276, 276, 228, 228, 228, 228, 228, 228, 228, 228, 254, 254, 254 },
            { 299, 299, 272, 272, 272, 217, 217, 217, 217, 217, 217, 217, 217, 219, 219, 219 },
            { 296, 296, 269, 269, 269, 207, 207, 207, 207, 207, 207, 207, 207, 186, 186, 186 }
        },
        /* au16EdgeStr */
        /* ISO */
        /* 100,    200,    400,    800,   1600,   3200,   6400,  12800,
         25600,  51200, 102400, 204800, 409600, 819200,1638400, 3276800 */
        {
            { 250, 256, 262, 279, 320, 417, 320, 320, 432, 258, 400, 224, 224, 224, 224, 224 },
            { 250, 260, 270, 296, 331, 421, 337, 337, 440, 291, 412, 244, 244, 244, 244, 244 },
            { 250, 264, 279, 314, 343, 425, 354, 355, 451, 325, 424, 265, 265, 265, 265, 265 },
            { 250, 268, 288, 332, 356, 429, 371, 373, 466, 359, 436, 285, 285, 285, 285, 285 },
            { 250, 272, 296, 350, 368, 433, 386, 390, 485, 391, 452, 303, 303, 303, 303, 303 },
            { 250, 276, 305, 368, 380, 437, 398, 406, 503, 420, 470, 319, 319, 319, 319, 319 },
            { 250, 280, 313, 384, 391, 441, 410, 421, 523, 448, 490, 333, 333, 333, 333, 333 },
            { 250, 286, 321, 398, 401, 445, 420, 436, 544, 475, 512, 346, 346, 346, 346, 346 },
            { 250, 292, 328, 411, 410, 448, 430, 451, 565, 501, 534, 357, 357, 357, 357, 357 },
            { 249, 299, 334, 420, 416, 450, 438, 463, 584, 525, 556, 364, 364, 364, 364, 364 },
            { 249, 307, 339, 428, 422, 452, 446, 475, 603, 548, 580, 370, 370, 370, 370, 370 },
            { 249, 316, 344, 434, 427, 453, 453, 486, 622, 570, 603, 374, 374, 374, 374, 374 },
            { 248, 326, 349, 439, 431, 454, 460, 498, 641, 592, 623, 379, 379, 379, 379, 379 },
            { 248, 335, 353, 442, 434, 455, 466, 511, 658, 614, 639, 384, 384, 384, 384, 384 },
            { 248, 344, 357, 445, 437, 456, 473, 524, 671, 637, 652, 390, 390, 390, 390, 390 },
            { 247, 351, 360, 447, 439, 456, 479, 538, 673, 658, 664, 394, 394, 394, 394, 394 },
            { 247, 357, 364, 449, 442, 457, 485, 550, 674, 674, 674, 398, 398, 398, 398, 398 },
            { 246, 361, 367, 450, 444, 456, 489, 563, 683, 686, 683, 398, 398, 398, 398, 398 },
            { 245, 364, 369, 450, 445, 455, 492, 575, 690, 691, 690, 398, 398, 398, 398, 398 },
            { 244, 366, 371, 450, 446, 454, 496, 585, 695, 695, 695, 398, 398, 398, 398, 398 },
            { 243, 366, 373, 448, 446, 453, 500, 590, 696, 696, 696, 398, 398, 398, 398, 398 },
            { 242, 366, 375, 445, 445, 451, 504, 594, 697, 697, 697, 398, 398, 398, 398, 398 },
            { 241, 366, 376, 441, 445, 450, 508, 597, 696, 696, 696, 399, 399, 399, 399, 399 },
            { 241, 366, 377, 436, 444, 449, 511, 600, 697, 697, 697, 402, 402, 402, 402, 402 },
            { 240, 365, 377, 429, 442, 448, 509, 601, 697, 697, 697, 405, 405, 405, 405, 405 },
            { 239, 363, 377, 422, 440, 447, 506, 600, 698, 698, 698, 408, 408, 408, 408, 408 },
            { 238, 361, 377, 413, 437, 446, 502, 600, 699, 699, 699, 411, 411, 411, 411, 411 },
            { 238, 359, 376, 403, 434, 446, 500, 600, 700, 700, 700, 413, 413, 413, 413, 413 },
            { 237, 356, 376, 393, 431, 445, 498, 600, 700, 700, 700, 411, 411, 411, 411, 411 },
            { 236, 353, 375, 383, 428, 445, 498, 600, 700, 700, 700, 408, 408, 408, 408, 408 },
            { 235, 351, 375, 373, 425, 444, 498, 600, 700, 700, 700, 405, 405, 405, 405, 405 },
            { 235, 349, 375, 364, 423, 444, 498, 600, 700, 700, 700, 402, 402, 402, 402, 402 }
        },
        /* au16TextureFreq */
        /* ISO */
        /* 100,    200,    400,    800,    1600,    3200,    6400,   12800,   25600,   51200,  102400,  204800,  409600,
           819200, 1638400, 3276800 */
        { 160, 170, 180, 180, 160, 160, 155, 170, 170, 170, 170, 170, 170, 170, 170, 170 },

        /* au16EdgeFreq */
        { 130, 115, 100, 100, 100, 100, 100, 100, 100, 100, 96, 96, 96, 96, 96, 96 },

        /* au8OverShoot */
        { 58, 70, 75, 70, 65, 55, 40, 40, 30, 30, 40, 40, 10, 10, 10, 10 },

        /* au8UnderShoot */
        { 70, 87, 90, 80, 80, 70, 60, 55, 45, 45, 50, 50, 15, 15, 15, 15 },

        /* au16shootSupStr */
        { 8, 8, 7, 7, 7, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0 },

        /* au8ShootSupAdj */
        { 9, 9, 8, 8, 7, 7, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0 },

        /* au8DetailCtrl */
        { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 120, 120, 120, 120, 120, 120 },

        /* au8DetailCtrlThr */
        { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160 },

        /* au8EdgeFiltStr */
        { 50, 50, 50, 55, 57, 60, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62 },

        /* au8EdgeFiltMaxCap */
        { 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 },

        /* au8RGain */
        { 28, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 },

        /* au8GGain */
        { 31, 31, 31, 31, 16, 16, 16, 16, 31, 31, 31, 31, 31, 31, 31, 31 },

        /* au8BGain */
        { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 },

        /* au8SkinGain */
        { 25, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31 },

        /* u8MaxSharpGain */
        { 67, 70, 72, 74, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80 },
        /* au8WeakDetailGain */
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
    },
};

static AWB_CCM_S g_stAwbCcm = {
    4,
    {
        {
            6800,
            { 0x0280, 0x813F, 0x8041, 0x8067, 0x0176, 0x800F, 0x801C, 0x8142, 0x025E },
        },

        {
            5000,
            { 0x0278, 0x8159, 0x801F, 0x8063, 0x0144, 0x001F, 0x8017, 0x81BA, 0x02D1 },
        },

        {
            3700,
            { 0x027C, 0x8114, 0x8068, 0x808C, 0x0169, 0x0023, 0x802B, 0x81BE, 0x02E9 },
        },

        {
            2650,
            { 0x027C, 0x8114, 0x8068, 0x808C, 0x0169, 0x0023, 0x802B, 0x81BE, 0x02E9 },
        },
    },
};

static AWB_AGC_TABLE_S g_stAwbAgcTable = {
    /* bvalid */
    1,

    /* 1,  2,  4,  8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 */
    /* saturation */
    { 0x80, 0x80, 0x7e, 0x72, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 }
};

static const ISP_CMOS_WDR_S g_stIspWDR = {
    /* bFusionMode */
    0,

    /* bMotionComp */
    1,

    /* u16ShortThr */
    4032,

    /* u16LongThr */
    3008,

    /* bForceLong */
    1,

    /* u16ForceLongLowThr */
    500,

    /* u16ForceLongHigThr */
    700,

    /* bShortExpoChk */
    0,

    /* u16ShortCheckThd */
    0x8,

    /* au8MdThrLowGain[16] */
    /* 1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 64, 64, 64, 64, 128, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },

    /* au8MdThrHigGain[16] */
    { 128, 128, 128, 128, 128, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },

    /* au16FusionThr[2] */
    { 3855, 3000 },

    /* u8MdtStillThd */
    0x14,

    /* u8MdtLongBlend */
    0x0
};

static const ISP_CMOS_DEHAZE_S g_stIspDehaze = {
    /* bEnable */
    1,
    /* bUserLutEnable */
    0,
    /* enOpType */
    0,
    /* u8AutoStrength */
    10,
    /* u8ManualStrength */
    10
};

static const ISP_CMOS_DRC_S g_stIspDRC = {
    /* bEnable */
    0,
    /* enOpType */
    0,
    /* u16ManualStrength */
    512,
    /* u16AutoStrength */
    512,
    /* u8SpatialFltCoef */
    1,
    /* u8RangeFltCoef */
    2,
    /* u8ContrastControl */
    8,
    /* s8DetailAdjustFactor */
    0,
    /* u8RangeAdaMax */
    8,
    /* u8FltScaleFine */
    6,
    /* u8FltScaleCoarse */
    6,
    /* u8GradRevMax */
    64,
    /* u8GradRevThr */
    50,
    /* u8BrightGainLmt */
    12,
    /* u8BrightGainLmtStep */
    8,
    /* u8DarkGainLmtY */
    0,
    /* u8DarkGainLmtC */
    0,
    /* u8PDStrength */
    35,
    /* u8LocalMixingBrightMax */
    64,
    /* u8LocalMixingBrightMin */
    32,
    /* u8LocalMixingBrightThr */
    96,
    /* s8LocalMixingBrightSlo */
    -3,
    /* u8LocalMixingDarkMax */
    64,
    /* u8LocalMixingDarkMin */
    32,
    /* u8LocalMixingDarkThr */
    200,
    /* s8LocalMixingDarkSlo */
    5,
    /* ColorCorrectionLut[33] */
    {
        831,  928,  1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
        1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024
    },
    /* ToneMappingValue[200] */
    {
        8,     8,     16,    24,    31,    39,    48,    56,    65,    75,    85,    95,    106,   118,   130,   143,
        156,   170,   185,   201,   218,   235,   254,   274,   294,   316,   339,   364,   390,   417,   446,   477,
        509,   543,   579,   617,   658,   701,   746,   794,   844,   898,   955,   1015,  1078,  1145,  1216,  1291,
        1370,  1454,  1543,  1637,  1736,  1841,  1952,  2069,  2194,  2325,  2465,  2612,  2767,  2932,  3106,  3290,
        3485,  3691,  3909,  4140,  4384,  4641,  4914,  5202,  5507,  5830,  6171,  6531,  6913,  7316,  7742,  8193,
        8669,  9173,  9705,  10268, 10863, 11492, 12145, 12808, 13483, 14171, 14872, 15587, 16319, 17069, 17840, 18635,
        19458, 19881, 20313, 20754, 21204, 21661, 22122, 22586, 23053, 23525, 24000, 24480, 24965, 25455, 25950, 26451,
        26959, 27473, 27995, 28524, 29062, 29609, 30165, 30732, 31309, 31899, 32501, 33116, 33746, 34391, 35043, 35706,
        36381, 37066, 37763, 38472, 39192, 39925, 40671, 41429, 42201, 42591, 42986, 43383, 43784, 44189, 44597, 45008,
        45424, 45842, 46265, 46691, 47121, 47555, 47993, 48434, 48880, 49329, 49783, 50241, 50703, 51169, 51639, 52113,
        52592, 53075, 53564, 54056, 54552, 55054, 55560, 56071, 56586, 56846, 57107, 57369, 57632, 57896, 58162, 58429,
        58697, 58967, 59238, 59510, 59783, 60057, 60333, 60611, 60889, 61169, 61451, 61733, 62017, 62303, 62589, 62877,
        63167, 63458, 63750, 64044, 64340, 64636, 64934, 65234
    },
    /* u8Asymmetry */
    2,
    /* u8SecondPole */
    180,
    /* u8Stretch */
    54,
    /* u8Compress */
    180,
    /* u8CurveSel */
    0,
    /* au16Xpoint */
    { 0, 200, 400, 600, 1000 },
    /* au16Ypoint */
    { 0, 200, 400, 600, 1000 },
    /* au16Slope */
    { 1000, 1000, 1000, 1000, 1000 }
};

static const ISP_CMOS_CA_S g_stIspCA = {
    /* CA */
    1,
    /* Y */
    {
        516,  525,  534,  544,  554,  563,  573,  583,  594,  604,  614,  624,  634,  644,  654,  664,  674,  684,  694,
        704,  713,  723,  732,  741,  750,  758,  766,  775,  782,  790,  797,  804,  811,  817,  823,  828,  834,  839,
        844,  848,  853,  857,  861,  865,  868,  872,  875,  878,  881,  884,  887,  890,  892,  895,  898,  900,  903,
        905,  908,  910,  913,  915,  918,  921,  924,  926,  929,  932,  935,  937,  940,  943,  945,  948,  950,  952,
        955,  957,  959,  961,  964,  966,  968,  970,  972,  974,  976,  978,  979,  981,  983,  985,  987,  988,  990,
        992,  993,  994,  995,  996,  997,  998,  998,  999,  1000, 1001, 1002, 1002, 1003, 1004, 1005, 1006, 1006, 1007,
        1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1018, 1019, 1020, 1022, 1024
    },
    /* ISO */
    /*  1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024, 2048, 4096, 8192, 16384, 32768 */
    { 1300, 1300, 1250, 1200, 1150, 1100, 1050, 1000, 950, 900, 900, 800, 800, 800, 800, 800 }
};

static const ISP_CMOS_LSC_S g_stCmosLsc = {
    /* MeshStrength */
    256,
    /* MeshScale */
    1,
    /* ISP_LSC_CABLI_TABLE_S */
    {
        {
            /* Rgain */
            {
                535, 453, 403, 363, 338, 316, 299, 292, 289, 291, 299, 314, 336, 361, 394, 449, 587,
                505, 433, 386, 351, 324, 303, 289, 281, 278, 281, 288, 303, 321, 348, 380, 429, 529,
                485, 419, 374, 341, 313, 295, 280, 272, 269, 272, 280, 293, 311, 338, 370, 413, 492,
                469, 407, 364, 332, 307, 287, 272, 265, 263, 266, 272, 286, 304, 329, 361, 402, 471,
                456, 397, 356, 325, 299, 279, 267, 261, 261, 263, 267, 279, 298, 321, 351, 392, 457,
                446, 389, 349, 319, 293, 274, 262, 259, 258, 261, 264, 274, 291, 315, 345, 385, 445,
                441, 386, 345, 314, 290, 271, 261, 257, 257, 259, 264, 270, 288, 310, 340, 378, 435,
                435, 382, 343, 313, 289, 269, 261, 257, 256, 258, 262, 268, 285, 308, 336, 377, 434,
                435, 384, 343, 312, 288, 268, 260, 257, 256, 257, 263, 268, 284, 307, 336, 375, 429,
                437, 385, 344, 313, 289, 270, 261, 257, 256, 258, 262, 268, 284, 308, 338, 377, 430,
                439, 388, 348, 318, 292, 272, 263, 259, 257, 259, 263, 269, 287, 310, 341, 378, 435,
                449, 392, 354, 322, 298, 277, 265, 261, 258, 262, 265, 273, 290, 316, 350, 386, 443,
                459, 403, 360, 329, 302, 284, 270, 264, 262, 264, 269, 278, 297, 322, 354, 394, 456,
                488, 412, 370, 336, 310, 289, 275, 268, 266, 268, 274, 285, 304, 330, 362, 412, 474,
                493, 426, 379, 347, 320, 299, 285, 278, 274, 275, 284, 296, 314, 341, 372, 421, 505,
                520, 443, 393, 360, 332, 308, 296, 286, 284, 288, 294, 307, 329, 354, 390, 442, 554,
                547, 463, 411, 375, 344, 322, 309, 299, 297, 299, 308, 320, 342, 369, 407, 465, 625
            },

            /* Grgain */
            {
                505, 433, 387, 355, 329, 310, 297, 290, 286, 290, 298, 310, 327, 352, 385, 434, 551,
                485, 419, 374, 342, 318, 300, 287, 279, 276, 280, 287, 299, 317, 340, 371, 416, 502,
                464, 403, 361, 331, 307, 291, 278, 271, 269, 271, 278, 290, 306, 330, 359, 400, 470,
                447, 392, 351, 323, 300, 283, 271, 264, 263, 266, 271, 282, 300, 322, 349, 389, 450,
                436, 382, 344, 316, 293, 276, 264, 261, 261, 263, 266, 276, 293, 315, 341, 380, 436,
                426, 376, 338, 310, 288, 272, 262, 258, 258, 261, 263, 272, 288, 309, 334, 371, 428,
                420, 370, 334, 306, 286, 268, 260, 257, 257, 259, 262, 269, 284, 304, 330, 366, 419,
                417, 369, 332, 305, 283, 267, 259, 257, 256, 258, 263, 267, 281, 302, 328, 363, 415,
                417, 369, 332, 305, 283, 267, 260, 257, 256, 258, 263, 267, 281, 300, 326, 362, 412,
                419, 370, 333, 306, 285, 268, 262, 258, 256, 258, 262, 267, 281, 301, 327, 364, 414,
                423, 374, 337, 310, 288, 270, 262, 259, 257, 259, 263, 269, 283, 303, 331, 367, 416,
                429, 379, 342, 314, 292, 274, 265, 261, 258, 262, 265, 272, 286, 309, 340, 373, 425,
                438, 388, 347, 320, 298, 281, 269, 263, 262, 264, 268, 276, 293, 313, 342, 380, 435,
                465, 396, 357, 327, 304, 287, 276, 269, 266, 268, 275, 283, 299, 322, 351, 400, 455,
                469, 409, 367, 337, 314, 296, 283, 276, 273, 276, 282, 293, 310, 332, 363, 406, 480,
                494, 425, 381, 349, 326, 305, 294, 287, 283, 286, 292, 302, 323, 345, 378, 425, 526,
                520, 444, 396, 362, 336, 318, 305, 296, 294, 298, 303, 316, 334, 360, 394, 446, 587
            },

            /* Gbgain */
            {
                504, 431, 386, 354, 330, 311, 296, 289, 286, 290, 297, 310, 331, 353, 385, 438, 561,
                483, 416, 374, 342, 317, 300, 287, 279, 276, 280, 288, 299, 317, 341, 371, 420, 504,
                461, 404, 362, 330, 306, 291, 279, 271, 268, 272, 279, 290, 306, 331, 361, 402, 474,
                446, 391, 351, 322, 299, 282, 271, 264, 263, 266, 272, 282, 300, 322, 351, 390, 453,
                437, 381, 344, 316, 293, 276, 265, 260, 261, 263, 266, 276, 293, 314, 341, 380, 438,
                429, 374, 338, 310, 289, 272, 262, 258, 258, 261, 263, 273, 288, 308, 336, 373, 428,
                420, 371, 333, 306, 285, 268, 260, 258, 257, 259, 263, 269, 284, 305, 332, 368, 420,
                416, 369, 332, 305, 283, 267, 259, 256, 256, 258, 262, 268, 283, 303, 328, 365, 417,
                416, 368, 332, 304, 284, 267, 260, 257, 256, 258, 263, 268, 282, 301, 327, 365, 413,
                418, 369, 333, 306, 284, 268, 262, 257, 256, 258, 262, 267, 282, 302, 330, 365, 415,
                422, 373, 336, 309, 287, 270, 262, 259, 257, 259, 263, 269, 283, 305, 332, 369, 420,
                430, 379, 340, 314, 292, 273, 264, 261, 259, 261, 266, 272, 287, 310, 340, 375, 426,
                436, 387, 347, 319, 297, 282, 269, 264, 262, 264, 268, 277, 293, 315, 344, 381, 439,
                465, 396, 356, 327, 303, 286, 275, 269, 266, 268, 274, 283, 300, 324, 353, 402, 454,
                470, 409, 367, 337, 313, 296, 283, 277, 273, 276, 283, 293, 311, 334, 364, 408, 482,
                495, 424, 380, 348, 324, 305, 294, 287, 283, 287, 293, 303, 323, 348, 380, 426, 529,
                525, 444, 396, 361, 336, 317, 305, 297, 295, 297, 305, 316, 338, 360, 394, 448, 592
            },

            /* Bgain */
            {
                485, 419, 379, 347, 323, 308, 292, 283, 280, 284, 292, 302, 319, 343, 368, 414, 518,
                463, 404, 365, 337, 313, 298, 284, 276, 272, 275, 282, 292, 309, 330, 357, 396, 470,
                448, 392, 354, 327, 304, 290, 276, 269, 266, 269, 275, 285, 301, 323, 347, 382, 444,
                434, 381, 346, 322, 300, 281, 269, 262, 261, 264, 269, 279, 296, 315, 339, 372, 428,
                423, 375, 339, 316, 294, 276, 264, 258, 259, 262, 264, 274, 289, 310, 333, 364, 416,
                415, 367, 334, 311, 289, 271, 261, 258, 257, 259, 262, 270, 285, 304, 327, 359, 408,
                411, 365, 333, 308, 287, 269, 260, 256, 256, 258, 262, 267, 282, 300, 324, 354, 399,
                410, 364, 332, 308, 284, 268, 259, 256, 256, 257, 261, 266, 279, 299, 322, 352, 396,
                409, 362, 331, 307, 285, 268, 259, 256, 256, 256, 262, 265, 279, 298, 322, 351, 396,
                410, 363, 333, 308, 285, 269, 261, 256, 256, 258, 261, 265, 279, 299, 322, 353, 397,
                413, 367, 336, 311, 289, 270, 261, 257, 256, 258, 262, 267, 280, 300, 324, 354, 399,
                418, 374, 338, 315, 292, 273, 263, 260, 258, 260, 263, 270, 284, 303, 333, 360, 408,
                430, 379, 345, 320, 298, 281, 267, 262, 261, 262, 265, 274, 289, 310, 334, 366, 416,
                454, 389, 353, 325, 304, 285, 272, 267, 264, 266, 271, 280, 294, 315, 341, 381, 431,
                456, 399, 362, 334, 311, 292, 280, 273, 271, 271, 278, 288, 303, 323, 350, 387, 453,
                482, 414, 374, 345, 322, 301, 291, 282, 279, 281, 288, 297, 313, 334, 364, 404, 494,
                503, 432, 386, 356, 332, 312, 300, 292, 290, 291, 297, 308, 326, 347, 380, 422, 548
            },
        },
        {
            /* Rgain */
            {
                535, 453, 403, 363, 338, 316, 299, 292, 289, 291, 299, 314, 336, 361, 394, 449, 587,
                505, 433, 386, 351, 324, 303, 289, 281, 278, 281, 288, 303, 321, 348, 380, 429, 529,
                485, 419, 374, 341, 313, 295, 280, 272, 269, 272, 280, 293, 311, 338, 370, 413, 492,
                469, 407, 364, 332, 307, 287, 272, 265, 263, 266, 272, 286, 304, 329, 361, 402, 471,
                456, 397, 356, 325, 299, 279, 267, 261, 261, 263, 267, 279, 298, 321, 351, 392, 457,
                446, 389, 349, 319, 293, 274, 262, 259, 258, 261, 264, 274, 291, 315, 345, 385, 445,
                441, 386, 345, 314, 290, 271, 261, 257, 257, 259, 264, 270, 288, 310, 340, 378, 435,
                435, 382, 343, 313, 289, 269, 261, 257, 256, 258, 262, 268, 285, 308, 336, 377, 434,
                435, 384, 343, 312, 288, 268, 260, 257, 256, 257, 263, 268, 284, 307, 336, 375, 429,
                437, 385, 344, 313, 289, 270, 261, 257, 256, 258, 262, 268, 284, 308, 338, 377, 430,
                439, 388, 348, 318, 292, 272, 263, 259, 257, 259, 263, 269, 287, 310, 341, 378, 435,
                449, 392, 354, 322, 298, 277, 265, 261, 258, 262, 265, 273, 290, 316, 350, 386, 443,
                459, 403, 360, 329, 302, 284, 270, 264, 262, 264, 269, 278, 297, 322, 354, 394, 456,
                488, 412, 370, 336, 310, 289, 275, 268, 266, 268, 274, 285, 304, 330, 362, 412, 474,
                493, 426, 379, 347, 320, 299, 285, 278, 274, 275, 284, 296, 314, 341, 372, 421, 505,
                520, 443, 393, 360, 332, 308, 296, 286, 284, 288, 294, 307, 329, 354, 390, 442, 554,
                547, 463, 411, 375, 344, 322, 309, 299, 297, 299, 308, 320, 342, 369, 407, 465, 625
            },
            /* Grgain */
            {
                505, 433, 387, 355, 329, 310, 297, 290, 286, 290, 298, 310, 327, 352, 385, 434, 551,
                485, 419, 374, 342, 318, 300, 287, 279, 276, 280, 287, 299, 317, 340, 371, 416, 502,
                464, 403, 361, 331, 307, 291, 278, 271, 269, 271, 278, 290, 306, 330, 359, 400, 470,
                447, 392, 351, 323, 300, 283, 271, 264, 263, 266, 271, 282, 300, 322, 349, 389, 450,
                436, 382, 344, 316, 293, 276, 264, 261, 261, 263, 266, 276, 293, 315, 341, 380, 436,
                426, 376, 338, 310, 288, 272, 262, 258, 258, 261, 263, 272, 288, 309, 334, 371, 428,
                420, 370, 334, 306, 286, 268, 260, 257, 257, 259, 262, 269, 284, 304, 330, 366, 419,
                417, 369, 332, 305, 283, 267, 259, 257, 256, 258, 263, 267, 281, 302, 328, 363, 415,
                417, 369, 332, 305, 283, 267, 260, 257, 256, 258, 263, 267, 281, 300, 326, 362, 412,
                419, 370, 333, 306, 285, 268, 262, 258, 256, 258, 262, 267, 281, 301, 327, 364, 414,
                423, 374, 337, 310, 288, 270, 262, 259, 257, 259, 263, 269, 283, 303, 331, 367, 416,
                429, 379, 342, 314, 292, 274, 265, 261, 258, 262, 265, 272, 286, 309, 340, 373, 425,
                438, 388, 347, 320, 298, 281, 269, 263, 262, 264, 268, 276, 293, 313, 342, 380, 435,
                465, 396, 357, 327, 304, 287, 276, 269, 266, 268, 275, 283, 299, 322, 351, 400, 455,
                469, 409, 367, 337, 314, 296, 283, 276, 273, 276, 282, 293, 310, 332, 363, 406, 480,
                494, 425, 381, 349, 326, 305, 294, 287, 283, 286, 292, 302, 323, 345, 378, 425, 526,
                520, 444, 396, 362, 336, 318, 305, 296, 294, 298, 303, 316, 334, 360, 394, 446, 587
            },

            /* Gbgain */
            {
                504, 431, 386, 354, 330, 311, 296, 289, 286, 290, 297, 310, 331, 353, 385, 438, 561,
                483, 416, 374, 342, 317, 300, 287, 279, 276, 280, 288, 299, 317, 341, 371, 420, 504,
                461, 404, 362, 330, 306, 291, 279, 271, 268, 272, 279, 290, 306, 331, 361, 402, 474,
                446, 391, 351, 322, 299, 282, 271, 264, 263, 266, 272, 282, 300, 322, 351, 390, 453,
                437, 381, 344, 316, 293, 276, 265, 260, 261, 263, 266, 276, 293, 314, 341, 380, 438,
                429, 374, 338, 310, 289, 272, 262, 258, 258, 261, 263, 273, 288, 308, 336, 373, 428,
                420, 371, 333, 306, 285, 268, 260, 258, 257, 259, 263, 269, 284, 305, 332, 368, 420,
                416, 369, 332, 305, 283, 267, 259, 256, 256, 258, 262, 268, 283, 303, 328, 365, 417,
                416, 368, 332, 304, 284, 267, 260, 257, 256, 258, 263, 268, 282, 301, 327, 365, 413,
                418, 369, 333, 306, 284, 268, 262, 257, 256, 258, 262, 267, 282, 302, 330, 365, 415,
                422, 373, 336, 309, 287, 270, 262, 259, 257, 259, 263, 269, 283, 305, 332, 369, 420,
                430, 379, 340, 314, 292, 273, 264, 261, 259, 261, 266, 272, 287, 310, 340, 375, 426,
                436, 387, 347, 319, 297, 282, 269, 264, 262, 264, 268, 277, 293, 315, 344, 381, 439,
                465, 396, 356, 327, 303, 286, 275, 269, 266, 268, 274, 283, 300, 324, 353, 402, 454,
                470, 409, 367, 337, 313, 296, 283, 277, 273, 276, 283, 293, 311, 334, 364, 408, 482,
                495, 424, 380, 348, 324, 305, 294, 287, 283, 287, 293, 303, 323, 348, 380, 426, 529,
                525, 444, 396, 361, 336, 317, 305, 297, 295, 297, 305, 316, 338, 360, 394, 448, 592
            },

            /* Bgain */
            {
                485, 419, 379, 347, 323, 308, 292, 283, 280, 284, 292, 302, 319, 343, 368, 414, 518,
                463, 404, 365, 337, 313, 298, 284, 276, 272, 275, 282, 292, 309, 330, 357, 396, 470,
                448, 392, 354, 327, 304, 290, 276, 269, 266, 269, 275, 285, 301, 323, 347, 382, 444,
                434, 381, 346, 322, 300, 281, 269, 262, 261, 264, 269, 279, 296, 315, 339, 372, 428,
                423, 375, 339, 316, 294, 276, 264, 258, 259, 262, 264, 274, 289, 310, 333, 364, 416,
                415, 367, 334, 311, 289, 271, 261, 258, 257, 259, 262, 270, 285, 304, 327, 359, 408,
                411, 365, 333, 308, 287, 269, 260, 256, 256, 258, 262, 267, 282, 300, 324, 354, 399,
                410, 364, 332, 308, 284, 268, 259, 256, 256, 257, 261, 266, 279, 299, 322, 352, 396,
                409, 362, 331, 307, 285, 268, 259, 256, 256, 256, 262, 265, 279, 298, 322, 351, 396,
                410, 363, 333, 308, 285, 269, 261, 256, 256, 258, 261, 265, 279, 299, 322, 353, 397,
                413, 367, 336, 311, 289, 270, 261, 257, 256, 258, 262, 267, 280, 300, 324, 354, 399,
                418, 374, 338, 315, 292, 273, 263, 260, 258, 260, 263, 270, 284, 303, 333, 360, 408,
                430, 379, 345, 320, 298, 281, 267, 262, 261, 262, 265, 274, 289, 310, 334, 366, 416,
                454, 389, 353, 325, 304, 285, 272, 267, 264, 266, 271, 280, 294, 315, 341, 381, 431,
                456, 399, 362, 334, 311, 292, 280, 273, 271, 271, 278, 288, 303, 323, 350, 387, 453,
                482, 414, 374, 345, 322, 301, 291, 282, 279, 281, 288, 297, 313, 334, 364, 404, 494,
                503, 432, 386, 356, 332, 312, 300, 292, 290, 291, 297, 308, 326, 347, 380, 422, 548
            },
        },
    },
};

static const ISP_CMOS_LCAC_S g_stIspLCac = {

    /* bEnable */
    1,
    /* u16PurpleDetRange */
    30,
    /* VarThr */
    0,
    /* au16RLumaThd */
    {1500, 1500, 0},
    /* au16GLumaThd */
    {1500, 1500, 0},
    /* au16BLumaThd */
    {4095, 1500, 0},
    /* au16YLumaThd */
    {3200, 1500, 0},
    /* as16CbCrRatio */
    { -50, -50, -50},
    /* enOpMode */
    0,
    /* stManual */
    {
        /* u8DePurpleCrStr */
        0,
        /* u8DePurpleCbStr */
        3
    },
    /* stAuto */
    {
        /* u8DePurpleCrStr */
        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
        /* u8DePurpleCbStr */
        { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }
    }
};

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif /* _SP2305_CMOS_EX_H_ */
